package methodImportUse.test2;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.function.IntFunction;

public class StuTest3 {
    public static void main(String[] args) {
        //将学生集合收集到学生类型的数组中
        //1.创建集合并添加数据
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list, "jack,22", "tom,33", "kk,23");
        String[] arr = list.stream().map(Student::replaceStr).toArray(new IntFunction<String[]>() {
            @Override
            public String[] apply(int value) {
                return new String[value];
            }
        });
        System.out.println(Arrays.toString(arr));

    }
}
